]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensions-app: Only change state if necessary
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 5 Jan 2024 09:52:08 +0000 (10:52 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sun, 7 Jan 2024 10:02:23 +0000 (10:02 +0000)
The `state-set` signal is emitted to change the underlying state,
which can have two reasons:

 1. the user toggled the switch
 2. the extension's `enabled` state changed externally

In the second case, calling enable/disable is pointless at best,
and can mess up the expected state by permanently disabling an
extension that was disabled because of the global kill switch.

Address this by only calling enable/disable if the new state does
not already match the current value of the `enabled` property.

Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7305

Fixes: fec523f83f ("extensions-app: Use new 'enabled' property")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3090>

subprojects/extensions-app/js/extensionRow.js

index 5847fb193e457684bff9add7383d00a9b904ab29..dac3b7f0143f1724ff55bbc142b1c3924774ade9 100644 (file)
@@ -59,7 +59,10 @@ export const ExtensionRow = GObject.registerClass({
         this._bindActionEnabled(actionEntries);
 
         this._switch.connect('state-set', (sw, state) => {
-            const {uuid} = this._extension;
+            const {uuid, enabled} = this._extension;
+            if (enabled === state)
+                return true;
+
             if (state)
                 this._app.extensionManager.enableExtension(uuid);
             else